<template>
	<view class="music-head" :style="{color: color}" >
		<view class="music-head-icon" v-if="showIcon" :class="{'music-head-black-style':blackStyle}">
			<text class="iconfont icon-zuojiantou" @tap="handleToBack"></text>
			|
			<text class="iconfont icon-shouye" @tap="handleToHome"></text>
		</view>
		<view class="title">
			{{title}}
		</view>
	</view>
</template>

<script>
	export default {
		name:"muscihead",
		data() {
			return {
				
			};
		},
		props:{
			title: {
				type: String,
				default: ''
			},
			showIcon: {
				type: Boolean,
				default: true
			},
			color: {
				type: String,
				default: "black"
			},
			blackStyle: {
				type: Boolean,
				default: false
			}
		},
		methods: {
			handleToBack() {
				uni.navigateBack();
			},
			handleToHome() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			}
		}
	}
</script>

<style scoped lang="less">
	.music-head {
		display: flex;
		position: relative;
		/* #ifdef MP-WEIXIN */
			top: 40rpx;
		/* #endif */
	
		width: 100%;
		height: 75px;
		font-size: 16px;
		line-height: 80px;
		text-align: center;
		color: #000;
		.music-head-icon {
			display: flex;
			justify-content: space-evenly;
			position: absolute;
			left: 8px;
			top: 26px;
			width: 90px;
			height: 30px;
			background: rgba(0,0,0,.4);
			color: #fff;
			line-height: 31px;
			border-radius: 15px;
		}
		.music-head-black-style {
			color: #000;
			border: 1px solid #eaeaea;
			background: #fff;
		}
		.title {
			width: 40vw;
			margin-left: 27vw;
			padding:0 30rpx;
			text-align: center;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}
	
</style>
